import java.awt.Color;
import java.awt.Graphics;

/**
 * 爆炸类
 * @author Shineflag
 *
 */
public class Explode {
	
	int x,y;
	
	private boolean live = true;
	
	private int [] diameter = {4,8,16,26,38,50,37,30,16,6,};
	private int step = 0;
	
	public Explode(int x,int y){
		this.x = x;
		this.y = y;
	}
	
	public void draw(Graphics g){
		if(!live)
			return;
		if(step == diameter.length){
			live = false;
			step = 0;
			return;
		}
		
		Color c = g.getColor();
		g.setColor(Color.ORANGE);
		g.fillOval(this.x, this.y, diameter[step], diameter[step]);
		g.setColor(c);
		
		step++;
		
		
	}

	public boolean isLive() {
		return live;
	}

	public void setLive(boolean live) {
		this.live = live;
	}
	

}
